pp108 : Modeling a Transaction

Modeling a Transaction

This topic describes the procedure to model a transaction in a business process model.

Before you begin this task:
Ensure that message mapping for all activities is done.


A set of activities is grouped as part of a transaction when they must be executed either entirely or not at all. In a transaction, all operations are either committed or rolled back.

  1. To design your business process model you may do any one of the following:
    • Select a starting point and click (<Business Process Model>) to open an existing business process model.
    • If you have the business process model already opened, then perform step 2.
  2. To group multiple activities as a transaction, right-click in the business process modeler and select Group as > Transaction. Alternatively, press Shift key to select required activities, right-click and select Group as > Transaction. The selected activities are grouped as a transaction.

Example of Modeling a Transaction


The following example describes the procedure to model a transaction in a business process model to check units in stock for each product, generate invoice and, update Accounts Receivable.

Business Requirements

The business process model should satisfy the following requirements:

  1. An order placed by a customer through an order entry system should trigger the transaction.
  2. The business process model should update the details of the order.
  3. The business process model should check if inventory is available to process the order.
  4. If inventory is not available, a notification should inform the customer that the request cannot be processed.
  5. If inventory exists, it should be updated for delivery of goods.
  6. An invoice must be generated and details of Accounts Receivable should be updated.
    Prerequisites

  7. Create a business process model using the requirements listed above. The business process model appears as follows:
    1. Create Web Service Interface on WS-AppServer Models for the following activities:
    • Update order details
    • Update inventory for goods delivery
    • Generate inventory and update Accounts Receivable
  8. Drag the Notify Application Service from the Workspace Documents > <Project> on to the business process model.

    Modeling the Transaction

    You must next model the transaction in the business process model and complete the Message Map for each activity in the business process model.

  9. Drag the GetOrdersInput message to the Start event. The Trigger type selected is Message in the Properties - Start Event pane. This message triggers the transaction.
  10. Drag the appropriate WS-AppServer method to the corresponding activity in the business process model.
  11. Select the activities that you want to group in the transaction; right-click and select Group as > Transaction.
  12. Double-click the transaction outline. Alternatively, right-click the transaction outline and select Properties. In the Properties - Transaction pane that appears, click the Data Source tab to ensure that SOAP Processor - Find one automatically is displayed by default in the text box beside Read Data Source from.
    Note: The Participate in Transaction check box (option available for WS-AppServer methods that are grouped in a transaction) is selected by default.
  13. Double-click the End event. Alternatively, right-click the End event and select Properties. In the Properties - End Event pane that appears, select Error as the End Type. The business process model appears as follows:


  14. Right-click in the business process modeler and select Business Process Execution > Validate and generate BPML. Warnings if any, appear in the Validate pane. Resolve the warnings appropriately.
  15. Right-click in the business process modeler and select Business Process Execution > Publish to Organization. The business process model is published to CoBOC.
  16. Right-click in the business process modeler and select Business Process Execution > Debug to verify that the business process model is executed properly.

    In this example, when a customer places an order through an order entry system, the entire transaction is triggered. The business process model first updates details of the order placed using the input parameters given in the Message Map. Next, the business process model checks if inventory is available for the order placed. If there is no inventory available, a notification is sent to the customer informing him or her that the order could not be processed and an error message is sent. If inventory is available, the inventory is updated to deliver goods to the customer. Finally, the invoice is generated and the Accounts Receivable is updated. If any Activity, for example, the Updating of Inventory or Updating of Accounts Receivable fails, the entire transaction is rolled back.

Related tasks

Setting the Properties of a Transaction

Related reference

Modeling Atomic and Open-ended Transactions
Permitted Activities in a Transaction
Properties of an Activity Within a Transaction
Transaction Construct Properties Interface
Compensate Event
Catch Exception

Related information

Process Execution Modes